package com.itheima.service.impl;

import com.itheima.dao.StudentDao;
import com.itheima.dao.impl.StudentDaoImpl;
import com.itheima.domain.Student;
import com.itheima.service.StudentService;

import java.util.ArrayList;

/*
    业务层实现类
 */
public class StudentServiceImpl implements StudentService {
    @Override
    //重写业务层添加方法
    public Student add(String name, int age, int score) {
        //实例化对象
        StudentDao studentDao = new StudentDaoImpl();
        //返回学生对象
        return studentDao.add(name,age,score);
    }

    @Override
    //重写业务层查询方法
    public ArrayList<Student> search() {
        //实例化对象
        StudentDao studentDao = new StudentDaoImpl();
        //返回学生对象集合
        return studentDao.search();
    }
}
